import libtcod.libtcodpy as libtcod

import widgets

class Console:
    
    def __init__(self, width=100, height=70, name='console', fps=60):
        self.width = width
        self.height = height
        libtcod.console_init_root(width, height, name, False)
        self.libtcod = libtcod
        


    def keycheck(self, turn=True):

        if turn == True:
            key = self.libtcod.console_wait_for_keypress(True)
        else:
            key = self.libtcod.console_check_for_keypress()
         
        return key.vk, key.c
    
                             
    def flush(self):
        self.libtcod.console_flush()
            
            
 
    
